package com.dzsw.test.mybatisp.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dzsw.test.mybatisp.entity.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.dzsw.test.mybatisp.service.IUserService;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author admin
 * @since 2020-08-12
 */
@RestController
@RequestMapping("/u")
public class UserController {

    @Resource
    private IUserService service;

    @GetMapping("/select")
    public Object select() {
        System.out.println(("----- selectAll method test ------"));
        List<User> userList = service.selectList();
        for(User user:userList) {
            System.out.println(user);
        }
        return userList;
    }

    @GetMapping("/s1")
    public Object s1(int p, int s) {
        return service.s1(p, s);
    }
}
